<?php

namespace addons\masksblock;

use app\common\library\Menu;
use think\Addons;

/**
 * 插件
 */
class Masksblock extends Addons
{
	protected $menu = [
		[
			'name'    => 'masks/block_cate',
			'title'   => '区块管理',
			'icon'    => 'fa fa-files-o',
			'ismenu'  => 1,
			'weigh'   => 0,
			'remark'  => '区块管理',
			'sublist' => [
				["name"  => "masks/block_cate/index","title" => "查看"],
				["name"  => "masks/block_cate/add","title" => "添加"],
				["name"  => "masks/block_cate/edit","title" => "编辑"],
				["name"  => "masks/block_cate/del","title" => "删除"],
				["name"  => "masks/block_cate/multi","title" => "批量更新"],
				["name"  => "masks/block/index","title" => "查看"],
				["name"  => "masks/block/add","title" => "添加"],
				["name"  => "masks/block/edit","title" => "编辑"],
				["name"  => "masks/block/del","title" => "删除"],
				["name"  => "masks/block/multi","title" => "批量更新"],
			]
		]
	];

    /**
     * 插件安装方法
     * @return bool
     */
    public function install()
    {
        Menu::create($this->menu);
        return true;
    }

    /**
     * 插件卸载方法
     * @return bool
     */
    public function uninstall()
    {
        Menu::delete("masksblock");
        return true;
    }

    /**
     * 插件启用方法
     * @return bool
     */
    public function enable()
    {
        Menu::enable("masksblock");
        return true;
    }

    /**
     * 插件禁用方法
     * @return bool
     */
    public function disable()
    {
        Menu::disable("masksblock");
        return true;
    }

}
